<template>
  <div class="app-container">
    <el-collapse v-model="activeName" accordion>
      <el-collapse-item name="1">
        <template slot="title">
          <i class="el-icon-search" />搜索栏
        </template>
        <div class="head-container">
          <el-form class="searchform" :inline="true" size="mini" label-width="auto">
            <el-form-item label="供应商号">
              <el-input v-model="searchData.createByVendorNbr" type="textarea" placeholder="请输入供应商号，多个回车换行隔开" clearable style="width: 200px;" />
            </el-form-item>

            <el-form-item label="部门">
              <el-input v-model="searchData.deptNbr" type="textarea" placeholder="请输入部门，多个回车换行隔开" clearable style="width: 200px;" />
            </el-form-item>

            <!-- <el-form-item v-if="requestType===3" label="供应商名称">
              <el-input v-model="searchData.createByVendorNbrName" placeholder="请输入供应商名称" clearable style="width: 200px;" />
            </el-form-item> -->

            <el-form-item label="UPC">
              <el-input v-model="searchData.upc" type="textarea" placeholder="请输入UPC，多个回车换行隔开" clearable style="width: 200px;" />
            </el-form-item>

            <el-form-item label="UPC(不含检验码)">
              <el-input v-model="searchData.sku" type="textarea" placeholder="请输入UPC(不含检验码)，多个回车换行隔开" clearable style="width: 200px;" />
            </el-form-item>
            <el-form-item label="商品名称">
              <el-input v-model.trim="searchData.skuName" placeholder="请输入商品说明" clearable style="width: 200px;" />
            </el-form-item>

            <el-form-item label="状态">
              <el-select v-model="searchData.mainStatus" style="width: 200px;" placeholder="请选择建品状态" clearable>
                <el-option
                  v-for="item in createGoodsStatus"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                />
              </el-select>
            </el-form-item>

            <el-form-item v-if="requestType===2" label="品牌名称">
              <el-input v-model="searchData.brandName" placeholder="输入品牌名称" clearable style="width: 200px;" />
            </el-form-item>
            <el-form-item label="建品方式">
              <el-select v-model="searchData.creationWay" style="width: 200px;" placeholder="请选择建品方式" clearable>
                <el-option
                  v-for="item in createGoodsTypeKind"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                />
              </el-select>
            </el-form-item>

            <el-form-item label="Fineline">
              <el-input v-model.trim="searchData.finelineNbr" placeholder="输入Fineline" clearable style="width: 200px;" />
            </el-form-item>
            <el-form-item label="创建时间">
              <el-date-picker
                v-model="searchData.createByDate"
                style="width: 200px;"
                value-format="yyyy-MM-dd HH:mm:ss"
                type="datetimerange"
                range-separator="-"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
              />
            </el-form-item>
            <el-form-item label="更新时间">
              <el-date-picker
                v-model="searchData.updataByDate"
                style="width: 200px;"
                value-format="yyyy-MM-dd HH:mm:ss"
                type="datetimerange"
                range-separator="-"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
              />
            </el-form-item>

            <el-form-item>
              <el-button class="filter-item" size="mini" icon="el-icon-download" style="float:right;margin-left:0px;" type="primary" round @click="$emit('download')">导出</el-button>
              <el-button size="mini" type="primary" style="float:right;margin-left:0px;" icon="el-icon-refresh" round @click="$emit('reset')">重置</el-button>
              <el-button size="mini" type="primary" style="float:right;margin-left:0px;" icon="el-icon-search" round @click="$emit('search')">查询</el-button>
            </el-form-item>
          </el-form>
        </div>
      </el-collapse-item>
    </el-collapse>
  </div>
</template>

<script>
import { createGoodsTypeKind, createGoodsStatus } from '@/views/coi/commonJs/dictionary'

export default {
  props: {
    searchData: {
      type: Object,
      default: () => {
        return {}
      }
    },
    requestType: {
      type: Number || null,
      default: null
    }
  },
  data() {
    return {
      activeName: '1',
      createGoodsTypeKind: createGoodsTypeKind,
      createGoodsStatus: createGoodsStatus
    }
  }
}
</script>
<style lang="scss" scoped>
.app-container{
  padding-bottom: 0;
}
</style>
